<?php
    //include 'functions.php';
    $dbLink = mysql_connect('localhost', 'root', "");
if(!$dbLink) {
    die("MySQL connection failed");
}
else
{
    mysql_select_db("mydb");
    $message_id = $_GET['message_id'];
    //query for deleting messages      
    $query1 = mysql_query("DELETE FROM member_message_member WHERE message_id = {$message_id}");
    if ($query1)
    {
        echo "<script type=text/javascript>", "alert('message deleted successfully');", "</script>";
    }
    else
    {
        echo "<script type=text/javascript>", "alert('error deleting message')", "</script>";
    }
}
?>